/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package actioncombination.common.value;

/**
 *
 * @author Administrador
 */
public class TupleValue extends Value<Value[]> {
	private Value[] value;

	private String string;

	public TupleValue(Value[] value) {
		this.value = value;
		StringBuilder s = new StringBuilder();
		s.append('<');
		boolean first = true;
		for (Value component : value) {
			if (first) {
				first = false;
			} else {
				s.append(", ");
			}
			s.append(component);
		}
		s.append('>');
		string = s.toString();
	}

	public TupleValue(Value[] value, String string) {
		this.value = value;
		this.string = string;
	}

	public Value[] getValue() {
		return value;
	}

	@Override
	public String toString() {
		return string;
	}

	@Override
	public boolean equals(Object object) {
		if (object instanceof TupleValue) {
			return string.equals(object.toString());
		}
		return false;
	}

	@Override
	public int hashCode() {
		return string.hashCode();
	}

    public int compareTo(Value[] o) {
        //CHOCHO
        
        throw new UnsupportedOperationException("Not supported yet.");
    }

}
